package edu.hawaii.duedates.web;

import org.apache.wicket.Page;
import org.apache.wicket.Request;
import org.apache.wicket.Response;
import org.apache.wicket.Session;
import org.apache.wicket.protocol.http.WebApplication;

import edu.hawaii.duedates.web.page.index.Index;

/**
 * Test Application.
 * @author Creighton Okada
 */
public class DueDatesTestApplication extends WebApplication {

  /**
   * Set home page for this application.
   * 
   * @return The home page.
   */
  @Override
  public Class<? extends Page> getHomePage() {
    return Index.class;
  }

  /**
   * Return a session object to hold the models for each user of this application.
   * 
   * @param request The request object.
   * @param response The response object.
   * @return The user session instance.
   */
  @Override
  public Session newSession(Request request, Response response) {
    return new DueDatesSession(this, request);
  }

  /**
   * Return this web application to provide a session for the current user instance.
   * 
   * @return The web application.
   */
  public static DueDatesTestApplication get() {
    return (DueDatesTestApplication) WebApplication.get();
  }
}
